//方法一
let person={
name:"Alice",
age:30,
city:"New York"
}

function Person(name,age,city){
this.name=name;
this.age=age;
this.city=city;
}

let person1=new Person("Alice",30,"Beijing");



let person2=Object.create(null);

person2.name="Alice";
person2.age=30;
person2.city="Tianjin"

console.log(person);
console.log(person1);
console.log(person2);

/*

对象的属性和方法

对象的属性可以是基本数据类型，对象，函数。
对象的方法可是对象的属性，值为函数

 */


person.data={
	carName:"fengtian",
	telephone:"13033333333"
}

console.log(person);

let result=JSON.stringify(person);

console.log(result);

let new_person=JSON.parse(result);

console.log(new_person); 